﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SpotsHub.RouteService.Data
{
    [Table("Route_Shipment")]
    public class Shipment : EntityBase, ITimeStamp
    {
        #region Required

        public int PickUpLocationId { get; set; }

        public int DeliveryLocationId { get; set; }

        //public int PackageId { get; set; }

        //public int PickUpContactorId { get; set; }

        //public int DeliveryContactorId { get; set; }

        #endregion

        #region Optional

        public int? SubmitterId { get; set; }

        #endregion

        #region Navigator

        public virtual Submitter Submitter { get; set; }

        public virtual Location PickUpLocation { get; set; }

        public virtual Location DeliveryLocation { get; set; }

        public virtual Package Package { get; set; }

        //public virtual Contactor PickUpContactor { get; set; }

        //public virtual Contactor DeliveryContactor { get; set; }

        #endregion

        #region Other

        public DateTime? ConfirmTime { get; set; }

        public DateTime? LastUpdate { get; set; }

        public ShipmentStatus Status { get; set; }

        [MaxLength(80)]
        public string TrackingNumber { get; set; }

        #endregion


        public Shipment()
        {
            Status = ShipmentStatus.Pending;
        }
    }

    public enum ShipmentStatus : byte
    {
        Pending,
        InProgress,
        Complete
    }
}
